package com.drools.drools.chapter5;

import com.drools.drools.BaseTest;
import com.drools.drools.model.Person;
import org.junit.Test;
import org.kie.api.runtime.StatelessKieSession;

import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: mishuai
 * Date: 2019-04-26
 * Time: 21:34
 * Des:
 */
public class StatelessSession extends BaseTest {

    @Test
    public void testStateLessSession(){

        StatelessKieSession statelessSession=this.getKieSessionByStatelessKieSessionName("stateless-rules");
        Person person=new Person();
        person.setAge(12);
        List<Person> list=new ArrayList<>();
        list.add(new Person(23));
        list.add(new Person(223));
        list.add(new Person(33));
        list.add(new Person(53));
        list.add(new Person(7));

        //statelessSession.execute(person);
        statelessSession.execute(list);
    }
}
